<?php
/*
 * @Author: lokei
 * @Date: 2022-09-28 20:55:13
 * @LastEditors: lokei
 * @LastEditTime: 2022-11-25 08:24:31
 * @Description: 
 */
$router->group(['prefix' => env('ROUTER_PREFIX') . 'api'], function () use ($router) {
	
	/** 帖子 */
	$router->group(['prefix' => 'topic'], function () use ($router) {
		// Topic
		$router->get('get', [
			'as' => 'getTopic', 'uses' => '\App\Http\Controllers\Topic\TopicController@get'
		]);
		$router->get('list', [
			'as' => 'TopicList', 'uses' => '\App\Http\Controllers\Topic\TopicController@list'
		]);
		$router->post('update', [
			'as' => 'updateTopic', 'uses' => '\App\Http\Controllers\Topic\TopicController@update'
		]);
		$router->post('create', [
			'as' => 'createTopic', 'uses' => '\App\Http\Controllers\Topic\TopicController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteTopic', 'uses' => '\App\Http\Controllers\Topic\TopicController@delete'
		]);
	});
	$router->group(['prefix' => 'topic', 'middleware' => 'auth'], function () use ($router) {
		$router->post('release', [
			'as' => 'releaseTopic', 'uses' => '\App\Http\Controllers\Topic\TopicController@release'
		]);
	});
	
	$router->group(['prefix' => 'topic/comment', 'middleware' => 'auth'], function () use ($router) {
		$router->post('submit', [
			'as' => 'submitTopicComment', 'uses' => '\App\Http\Controllers\Topic\CommentController@submit'
		]);
	});
	
	$router->group(['prefix' => 'topic/like', 'middleware' => 'auth'], function () use ($router) {
		$router->post('submit', [
			'as' => 'submitTopicLike', 'uses' => '\App\Http\Controllers\Topic\LikeController@submit'
		]);
	});
	
	$router->group(['prefix' => 'topic/like', 'middleware' => 'auth'], function () use ($router) {
		$router->get('ofTopics', [
			'as' => 'ofTopicsLike', 'uses' => '\App\Http\Controllers\Topic\LikeController@ofTopics'
		]);
	});
});
